
function checkIdentify(identify){
var reg=/^\d+-([A-Z]*\d*([A-Z]+|\d+))+-\d+X$/;
if(identify.match(reg)){
return true;
}else{
return false;
}

}








function orderProcessMonitor(employeeno,identify,printno){
	if(employeeno!=""&&identify!=""){
	ProcessMonitorAction.orderProcessMonitor(employeeno,identify,printno,function(data){
		if(data=="yes"){
			document.all.alertdis.className='alertdisb';
			document.all.alertdis.innerText=straa;
                        includePage(cuerrentorderprocess,"querydis");

		}else if(data=="no"){
			document.all.alertdis.className='alertdisa';
			document.all.alertdis.innerText=strbb;
		}else if(data=="error"){
                document.all.alertdis.className='alertdisa';
                document.all.alertdis.innerText=strff;
                }

		});
	}
}

function init(){
document.all.scanerdata.focus();
document.all.scanerdata.value="";
}

function dataFilte(){
var scanerdata=document.all.scanerdata.value;
var datalength=document.all.scanerdata.value.length;
var employeeno=document.all.employeeno.value;

if(scanerdata=="print"){
ReYoPrint.PrintDirect();
document.all.scanerdata.value="";
}
if(scanerdata=="clear"){
clearCurrentProcessContent();
document.all.scanerdata.value="";
}



var idw=false;
var stringend=false;

for(i=0;i<datalength;i++){
var doc=scanerdata.charAt(i) ;
if(doc=="E"&&i==0){
	idw=true;
	}//end if
if(doc=="X"){
	stringend=true;
	}//end if

}//end for

if(idw==true&&stringend==true){
	document.all.employeeno.value=scanerdata;
	employeeno=scanerdata;
	document.all.scanerdata.value="";
	document.all.identify.value="";
        document.all.alertdis.className='alertdisb';
        document.all.alertdis.innerText=strdd;
}else if(idw==false&&stringend==true&&employeeno!=""){
	document.all.identify.value=scanerdata;
        document.all.alertdis.className='alertdisb';
        document.all.alertdis.innerText=stree;
        document.all.scanerdata.value="";
    if(checkIdentify(scanerdata)==true){
    orderProcessMonitor(employeeno,scanerdata,myss);
    }
    if(checkIdentify(scanerdata)==false){
    document.all.alertdis.className='alertdisa';
     document.all.alertdis.innerText="错误的产品编号格式!" ;
}

}else if(idw==false&&stringend==true&&employeeno==""){
	document.all.alertdis.className='alertdisa';
	document.all.alertdis.innerText=strcc;
	document.all.scanerdata.value="";
}


}

function clearCurrentProcessContent(){

             ProcessMonitorAction.clearCurrentProcessContent();
             includePage(cuerrentorderprocess,"querydis");
}



function printA(){ $.jPrintArea('#querydis') ;}
